//### This file created by BYACC 1.8(/Java extension  1.15)
//### Java capabilities added 7 Jan 97, Bob Jamison
//### Updated : 27 Nov 97  -- Bob Jamison, Joe Nieten
//###           01 Jan 98  -- Bob Jamison -- fixed generic semantic constructor
//###           01 Jun 99  -- Bob Jamison -- added Runnable support
//###           06 Aug 00  -- Bob Jamison -- made state variables class-global
//###           03 Jan 01  -- Bob Jamison -- improved flags, tracing
//###           16 May 01  -- Bob Jamison -- added custom stack sizing
//###           04 Mar 02  -- Yuval Oren  -- improved java performance, added options
//###           14 Mar 02  -- Tomas Hurka -- -d support, static initializer workaround
//### Please send bug reports to tom@hukatronic.cz
//### static char yysccsid[] = "@(#)yaccpar	1.8 (Berkeley) 01/20/90";






//#line 2 "nudroid.y"
import java.io.*;
//#line 19 "Parser.java"




public class Parser
{

boolean yydebug;        //do I want debug output?
int yynerrs;            //number of errors so far
int yyerrflag;          //was there an error?
int yychar;             //the current working character

//########## MESSAGES ##########
//###############################################################
// method: debug
//###############################################################
void debug(String msg)
{
  if (yydebug)
    System.out.println(msg);
}

//########## STATE STACK ##########
final static int YYSTACKSIZE = 500;  //maximum stack size
int statestk[] = new int[YYSTACKSIZE]; //state stack
int stateptr;
int stateptrmax;                     //highest index of stackptr
int statemax;                        //state when highest index reached
//###############################################################
// methods: state stack push,pop,drop,peek
//###############################################################
final void state_push(int state)
{
  try {
		stateptr++;
		statestk[stateptr]=state;
	 }
	 catch (ArrayIndexOutOfBoundsException e) {
     int oldsize = statestk.length;
     int newsize = oldsize * 2;
     int[] newstack = new int[newsize];
     System.arraycopy(statestk,0,newstack,0,oldsize);
     statestk = newstack;
     statestk[stateptr]=state;
  }
}
final int state_pop()
{
  return statestk[stateptr--];
}
final void state_drop(int cnt)
{
  stateptr -= cnt; 
}
final int state_peek(int relative)
{
  return statestk[stateptr-relative];
}
//###############################################################
// method: init_stacks : allocate and prepare stacks
//###############################################################
final boolean init_stacks()
{
  stateptr = -1;
  val_init();
  return true;
}
//###############################################################
// method: dump_stacks : show n levels of the stacks
//###############################################################
void dump_stacks(int count)
{
int i;
  System.out.println("=index==state====value=     s:"+stateptr+"  v:"+valptr);
  for (i=0;i<count;i++)
    System.out.println(" "+i+"    "+statestk[i]+"      "+valstk[i]);
  System.out.println("======================");
}


//########## SEMANTIC VALUES ##########
//public class ParserVal is defined in ParserVal.java


String   yytext;//user variable to return contextual strings
ParserVal yyval; //used to return semantic vals from action routines
ParserVal yylval;//the 'lval' (result) I got from yylex()
ParserVal valstk[];
int valptr;
//###############################################################
// methods: value stack push,pop,drop,peek.
//###############################################################
void val_init()
{
  valstk=new ParserVal[YYSTACKSIZE];
  yyval=new ParserVal();
  yylval=new ParserVal();
  valptr=-1;
}
void val_push(ParserVal val)
{
  if (valptr>=YYSTACKSIZE)
    return;
  valstk[++valptr]=val;
}
ParserVal val_pop()
{
  if (valptr<0)
    return new ParserVal();
  return valstk[valptr--];
}
void val_drop(int cnt)
{
int ptr;
  ptr=valptr-cnt;
  if (ptr<0)
    return;
  valptr = ptr;
}
ParserVal val_peek(int relative)
{
int ptr;
  ptr=valptr-relative;
  if (ptr<0)
    return new ParserVal();
  return valstk[ptr];
}
final ParserVal dup_yyval(ParserVal val)
{
  ParserVal dup = new ParserVal();
  dup.ival = val.ival;
  dup.dval = val.dval;
  dup.sval = val.sval;
  dup.obj = val.obj;
  return dup;
}
//#### end semantic value section ####
public final static short IDENTIFIER=257;
public final static short NAME=258;
public final static short NUMBER=259;
public final static short STRING=260;
public final static short UNFORMATTED_STRING=261;
public final static short T_NUDROID=262;
public final static short CT_NUDROID=263;
public final static short T_NAVIGATION=264;
public final static short CT_NAVIGATION=265;
public final static short T_STYLE=266;
public final static short CT_STYLE=267;
public final static short T_PAGE=268;
public final static short CT_PAGE=269;
public final static short T_TEXT=270;
public final static short CT_TEXT=271;
public final static short T_INPUT=272;
public final static short CT_INPUT=273;
public final static short T_LINK=274;
public final static short CT_LINK=275;
public final static short T_IMAGE=276;
public final static short CT_IMAGE=277;
public final static short T_LIST=278;
public final static short CT_LIST=279;
public final static short T_TABLE=280;
public final static short CT_TABLE=281;
public final static short T_AUDIO=282;
public final static short CT_AUDIO=283;
public final static short T_VIDEO=284;
public final static short CT_VIDEO=285;
public final static short T_BUTTON=286;
public final static short CT_BUTTON=287;
public final static short T_FUNCTION=288;
public final static short CT_FUNCTION=289;
public final static short T_VAR=290;
public final static short CT_VAR=291;
public final static short T_GOTO=292;
public final static short T_SETVAR=293;
public final static short T_GETVAR=294;
public final static short T_GETINPUT=295;
public final static short T_GETTEXT=296;
public final static short T_SETTEXT=297;
public final static short T_LOOP=298;
public final static short CT_LOOP=299;
public final static short T_TEST=300;
public final static short CT_TEST=301;
public final static short T_TRUE=302;
public final static short CT_TRUE=303;
public final static short T_FALSE=304;
public final static short CT_FALSE=305;
public final static short B_TRUE=306;
public final static short B_FALSE=307;
public final static short P_NAME=308;
public final static short P_PAGEID=309;
public final static short P_URL=310;
public final static short P_EMAIL=311;
public final static short P_BULLET_STYLE=312;
public final static short P_TYPE=313;
public final static short P_COLS=314;
public final static short P_FUNCTIONID=315;
public final static short P_VALUE=316;
public final static short P_CONDITION=317;
public final static short P_START=318;
public final static short P_END=319;
public final static short P_ID=320;
public final static short P_LABEL=321;
public final static short P_STYLEID=322;
public final static short P_POSITION=323;
public final static short P_LENGTH=324;
public final static short P_WIDTH=325;
public final static short P_LOCATION=326;
public final static short P_SIZE=327;
public final static short P_COLOR=328;
public final static short P_FONT=329;
public final static short P_LORIENTATION=330;
public final static short serif=342;
public final static short sans=343;
public final static short mono=344;
public final static short numbers=346;
public final static short AtoZ=347;
public final static short atoz=348;
public final static short circles=349;
public final static short square=350;
public final static short disc=351;
public final static short vertical=352;
public final static short horizontal=353;
public final static short number=354;
public final static short string=355;
public final static short top=359;
public final static short bottom=360;
public final static short left=361;
public final static short right=362;
public final static short center=363;
public final static short YYERRCODE=256;
final static short yylhs[] = {                           -1,
    0,    2,    2,    3,    3,    3,    3,    1,    5,    8,
    8,    9,    7,   12,   12,   13,   13,   13,   13,   13,
   13,   13,   13,   13,   14,   15,   16,   17,   18,   19,
   20,   21,   22,   23,   23,   23,    4,   25,   25,   26,
   26,   26,   26,   26,   26,   26,   26,   26,   26,   24,
   24,   37,   37,   27,   40,   40,   42,   28,   43,   43,
   44,   10,   10,   46,   46,   46,   47,   47,   51,   49,
   48,   50,   29,   29,   52,   52,   53,   53,   53,   53,
   53,   53,   53,   30,   60,   60,   62,   62,   62,   61,
   61,   65,   65,   65,   63,   64,   66,   66,   66,   66,
   66,   66,   67,   67,   31,   68,   68,   70,   70,   70,
   70,   70,   71,   69,   69,   72,   72,   72,   35,   73,
   73,   74,   74,   74,   74,   74,   36,   76,   76,   77,
   77,   77,   77,   77,   32,   78,   78,   79,   79,   79,
   79,   80,    6,    6,   81,   64,   64,   82,   82,   34,
   84,   84,   33,   33,   33,   33,   33,   33,   33,   33,
   33,   85,   86,   87,   88,   89,   90,   83,   83,   83,
   93,   93,   93,   94,   94,   95,   95,   95,   95,   96,
   96,   96,   96,   96,   96,   97,   97,   97,   97,   97,
   91,   98,   99,   92,   11,   45,   45,   38,   39,   59,
  100,  100,  100,  100,  100,   75,   75,   54,   55,   56,
   57,   57,   57,  101,  102,  103,   58,  104,  104,   41,
   41,   41,   41,   41,   41,
};
final static short yylen[] = {                            2,
    5,    0,    2,    1,    1,    1,    1,    2,    3,    0,
    2,    1,    5,    0,    2,    1,    1,    1,    1,    1,
    1,    1,    1,    1,    2,    2,    2,    2,    2,    2,
    2,    2,    2,    1,    1,    1,    6,    0,    2,    1,
    1,    1,    1,    1,    1,    1,    1,    1,    1,    0,
    2,    1,    1,    6,    0,    2,    1,    6,    0,    2,
    1,    7,    5,    1,    1,    1,    0,    2,    1,    2,
    2,    2,    5,    3,    0,    2,    1,    1,    1,    1,
    1,    1,    1,    5,    0,    2,    1,    1,    1,    0,
    2,    1,    1,    1,    2,    2,    1,    1,    1,    1,
    1,    1,    1,    1,    6,    0,    2,    1,    1,    1,
    1,    1,    2,    0,    2,    1,    1,    1,    6,    0,
    2,    1,    1,    1,    1,    1,    6,    0,    2,    1,
    1,    1,    1,    1,    6,    0,    2,    1,    1,    1,
    1,    2,    5,    4,    2,    1,    1,    2,    2,    5,
    1,    2,    1,    1,    1,    1,    1,    1,    1,    1,
    1,    3,    4,    3,    3,    3,    4,    3,    3,    1,
    3,    3,    1,    3,    1,    1,    1,    1,    1,    3,
    3,    2,    3,    1,    1,    1,    1,    1,    1,    1,
    7,    3,    3,    8,    2,    0,    1,    2,    2,    2,
    1,    1,    1,    1,    1,    1,    1,    2,    2,    2,
    1,    1,    1,    2,    2,    2,    2,    1,    1,    0,
    2,    2,    2,    2,    2,
};
final static short yydefred[] = {                         0,
    0,    0,    0,    0,    8,    2,    0,    1,   10,    0,
    0,    0,    3,    4,    5,    6,    7,    0,    0,    0,
   50,    0,    9,    0,   11,   12,  195,   14,    0,    0,
    0,  197,    0,    0,    0,    0,   38,   51,   52,   53,
    0,  146,  147,  145,    0,  144,    0,    0,    0,    0,
   67,   64,   65,   66,   13,    0,    0,    0,    0,    0,
    0,    0,    0,    0,   15,   16,   17,   18,   19,   20,
   21,   22,   23,   24,  198,  199,    0,  103,  104,   96,
  179,  176,  149,    0,    0,    0,    0,  177,  178,    0,
  173,  175,  143,   70,   71,   72,    0,   25,   34,   35,
   36,   26,   27,   28,   29,   30,   31,   32,   33,   37,
    0,    0,   75,   85,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,  153,   39,   40,   41,   42,   43,
   44,   45,   46,   47,   48,   49,  154,  155,  156,  157,
  158,  159,  160,  161,    0,    0,    0,    0,    0,    0,
    0,    0,   63,   69,   68,   55,   59,    0,    0,  106,
  120,  128,  136,    0,    0,    0,    0,    0,    0,  164,
  165,  174,    0,    0,  171,  172,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,  220,   74,   80,
   76,   77,   78,   79,   81,   82,   83,  211,  212,  213,
    0,   90,   87,   86,   88,   89,    0,    0,    0,    0,
    0,  162,    0,  166,    0,    0,  184,  185,    0,    0,
    0,   62,  220,   57,   56,    0,   61,   60,  201,  202,
  203,  204,  205,  200,  208,  209,  210,  214,  215,  216,
  218,  219,  217,    0,   97,   98,   99,  100,  101,  102,
   95,    0,    0,  114,  110,  108,  111,  112,  107,  109,
  220,  123,  207,  206,  124,  125,  126,  121,  122,  220,
  131,  132,  133,  134,  130,  129,    0,    0,  138,  140,
  141,  137,  139,  151,    0,  163,  167,    0,  182,  187,
  186,  188,  189,  190,    0,    0,    0,    0,    0,    0,
  221,   73,    0,  222,  223,  224,  225,   84,   94,   92,
   93,   91,  113,    0,    0,    0,  142,    0,  150,  152,
    0,    0,    0,  181,    0,    0,   54,   58,    0,  105,
  117,  116,  118,  115,  119,  127,  135,    0,    0,    0,
    0,    0,  192,    0,  191,  194,  193,
};
final static short yydgoto[] = {                          2,
    4,    7,   13,   14,   15,  125,   17,   18,   25,  304,
   20,   34,   65,   66,   67,   68,   69,   70,   71,   72,
   73,   74,  102,   29,   77,  126,  127,  128,  129,  130,
  131,  132,  284,  134,  135,  136,   38,   39,   40,  178,
  244,  225,  179,  228,   33,   51,   97,   52,   53,   54,
  155,  158,  191,  263,  264,  194,  195,  196,  197,  159,
  252,  204,  205,   44,  312,  251,   80,  207,  314,  259,
  260,  334,  208,  268,  269,  209,  276,  210,  282,  283,
   31,   47,  220,  285,  137,  138,   88,   89,  141,  142,
  143,  144,   90,   91,   92,  221,  295,  326,  341,  234,
  198,  199,  200,  243,
};
final static short yysindex[] = {                      -220,
 -260,    0, -204,   -4,    0,    0, -193,    0,    0, -259,
 -259, -259,    0,    0,    0,    0,    0, -189, -194,    6,
    0, -235,    0, -259,    0,    0,    0,    0,  -36, -275,
  -17,    0, -109, -231, -172, -158,    0,    0,    0,    0,
 -191,    0,    0,    0,   16,    0,   49, -140, -127, -123,
    0,    0,    0,    0,    0, -119, -103, -115,  -95, -102,
  -82,  -81,  -79,  -76,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0, -101,    0,    0,    0,
    0,    0,    0, -259, -259,  111,   91,    0,    0,   45,
    0,    0,    0,    0,    0,    0,  -50,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 -259, -259,    0,    0, -259, -259, -259, -259, -259, -125,
 -259, -259, -132, -121,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,  126,  128,  112,  111,  111,  111,
  111,  -63,    0,    0,    0,    0,    0,    4,  -48,    0,
    0,    0,    0,  148,  150,  -84,  -15,  111,   41,    0,
    0,    0,   45,   45,    0,    0,  -49,  -39,  -30, -213,
  -25,  -13,  -18,   -7,   -6,    9, -116,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
  -90,    0,    0,    0,    0,    0,   53,   29,   36,   57,
  121,    0,  217,    0,  280,  -10,    0,    0,   41,  -32,
  -61,    0,    0,    0,    0,   82,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0, -212,    0,    0,    0,    0,    0,    0,
    0, -207,   86,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,   92,  108,    0,    0,
    0,    0,    0,    0,  -45,    0,    0,  111,    0,    0,
    0,    0,    0,    0,  111,   41,   41,   50, -136,  100,
    0,    0, -259,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0, -224, -129, -122,    0,   89,    0,    0,
   -2,   91,   58,    0,  121,   73,    0,    0,  326,    0,
    0,    0,    0,    0,    0,    0,    0,  121,  -65,  121,
   88,  101,    0,  -87,    0,    0,    0,
};
final static short yyrindex[] = {                         0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,  -43,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,  336,    0,    0,  -41,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,  -38,  -35,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,  -44,  -42,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,
};
final static short yygindex[] = {                         0,
    0,    0,    0,    0,    0,  395,    0,    0,    0,   -9,
    5,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0, -218,    0, -215,    0,
    0,    0,  -62,    0,    0,    0,    0,  196,  -66,    0,
 -184,    0,    0,    0,    0,    0,    0, -114,  284,    0,
    0,    0,    0,  249,  252,   54,    7,   12,    0,    0,
    0,    0,    0,  261,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,  213,    0,    0,    0,    0,    0,
    0,  136,   56, -285,    0,    0,   93,  127, -185,    0,
    0,    0,  164,  190,    0, -168,    0,    0,    0,    0,
    0,    0,    0,    0,
};
final static int YYTABLESIZE=471;
static short yytable[];
static { yytable();}
static void yytable(){
yytable = new short[]{                        170,
  298,  170,  168,  170,  168,  169,  168,  169,   26,  169,
  148,  152,  149,  202,  133,   21,   22,  183,  170,  180,
  170,  168,  223,  168,  169,   37,  169,  291,   32,  290,
  154,  226,  148,  310,  149,   55,  311,   41,  299,  339,
  148,    1,  149,  190,   46,  111,  214,    3,  301,   24,
  289,  113,  342,    5,  344,   86,  330,    6,  307,  338,
   19,   24,  111,   27,  302,  188,   24,   28,  113,    8,
    9,  308,   10,  219,   11,   23,  315,   30,   42,   43,
   86,   84,   85,  303,   24,  316,  150,   75,  145,  146,
  261,  151,  203,  262,  271,  332,   12,  270,  333,   76,
   87,   56,   57,   58,   59,   60,   61,   62,   63,   64,
   93,  224,  227,  307,  254,  156,  157,   94,  278,  160,
  161,  162,  163,  164,  301,  166,  167,  323,  324,  307,
  307,  301,   95,  148,  327,  149,   96,   24,  301,   98,
  256,  147,  103,  279,   24,  229,  230,  231,  232,  233,
   86,   24,  172,  335,  148,  105,  149,   84,   85,  303,
   78,   79,  336,  104,   84,   85,  303,  110,  111,  139,
  112,   84,   85,  303,  113,  106,  114,  107,  115,  108,
  116,  109,  117,   48,  118,  168,  119,  170,   12,  171,
  120,  121,   84,   85,  122,  169,  123,  177,  124,   48,
   49,   50,   12,  140,  120,  121,   84,   85,  122,  211,
  123,  212,  124,  257,  266,  273,  280,  347,  258,  267,
  274,  281,  320,  216,   12,  222,  120,  121,   84,   85,
  122,   45,  123,  235,  124,  241,  242,  343,   99,  100,
  101,  237,  309,  319,   12,  236,  120,  121,   84,   85,
  122,  238,  123,  239,  124,  245,  246,  247,  248,  249,
  250,  265,  272,  201,   41,  196,  196,  196,  240,  296,
  297,   36,   81,   36,   82,   83,  320,  170,  286,  320,
  168,  320,   36,  169,   35,   36,  183,  183,  180,  170,
  170,   36,  168,  168,  153,  169,  169,   81,   45,   82,
   45,  213,  215,  139,  331,   42,   43,  329,  288,   84,
   85,  173,  174,   49,  170,  170,  170,  168,  168,  168,
  169,  169,  169,  292,  293,  294,  180,  181,  182,  183,
  184,  185,  186,  187,   84,   85,  305,  140,   49,  175,
  176,  287,  300,  321,  313,   49,  217,  218,  189,  317,
  322,  325,  181,  182,  183,  184,  185,  186,  187,  181,
  182,  183,  184,  185,  186,  187,  253,   81,  318,   82,
  306,  277,  328,   35,   36,  337,  340,  139,   36,  184,
  185,  186,  187,  184,  185,  186,  187,  214,  345,  297,
   12,  305,  120,  121,   84,   85,  122,  148,  123,  346,
  124,   16,  255,  165,   84,   85,  192,  305,  305,  193,
   12,  140,  120,  121,   84,   85,  122,  139,  123,  206,
  124,  275,    0,    0,    0,  306,    0,    0,    0,    0,
  139,  139,  139,    0,  139,    0,  139,    0,    0,    0,
    0,  306,  306,    0,    0,    0,    0,    0,    0,    0,
    0,  140,    0,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,  140,  140,  140,    0,  140,    0,
  140,
};
}
static short yycheck[];
static { yycheck(); }
static void yycheck() {
yycheck = new short[] {                         41,
   62,   43,   41,   45,   43,   41,   45,   43,   18,   45,
   43,   62,   45,   62,   77,   11,   12,   62,   60,   62,
   62,   60,   62,   62,   60,   62,   62,   60,   24,   62,
   97,   62,   43,  252,   45,  267,  252,  313,  223,  325,
   43,  262,   45,  158,   62,  270,   62,  308,  261,  274,
  219,  276,  338,  258,  340,   40,  281,   62,  244,   62,
  320,  274,  270,  258,  277,   62,  274,   62,  276,  263,
  264,  279,  266,   33,  268,  265,  261,  313,  354,  355,
   40,  294,  295,  296,  274,  270,   42,  260,   84,   85,
   62,   47,  159,  208,  209,  314,  290,   62,  314,  258,
   45,  333,  334,  335,  336,  337,  338,  339,  340,  341,
   62,  178,  179,  299,   62,  111,  112,  258,   62,  115,
  116,  117,  118,  119,  261,  121,  122,  296,  297,  315,
  316,  261,  260,   43,  271,   45,  260,  274,  261,  259,
  207,   86,  258,  210,  274,  359,  360,  361,  362,  363,
   40,  274,   41,  283,   43,  258,   45,  294,  295,  296,
  352,  353,  285,  259,  294,  295,  296,  269,  270,   77,
  272,  294,  295,  296,  276,  258,  278,  259,  280,  259,
  282,  258,  284,  309,  286,  318,  288,   62,  290,   62,
  292,  293,  294,  295,  296,  317,  298,  261,  300,  309,
  310,  311,  290,   77,  292,  293,  294,  295,  296,   62,
  298,   62,  300,  207,  208,  209,  210,  305,  207,  208,
  209,  210,  285,  168,  290,  275,  292,  293,  294,  295,
  296,  316,  298,  259,  300,  352,  353,  303,  342,  343,
  344,  260,  252,  289,  290,  259,  292,  293,  294,  295,
  296,  259,  298,  260,  300,  346,  347,  348,  349,  350,
  351,  208,  209,  312,  313,  309,  310,  311,  260,  331,
  332,  322,  257,  322,  259,  260,  339,  319,   62,  342,
  319,  344,  322,  319,  321,  322,  331,  332,  331,  331,
  332,  322,  331,  332,  345,  331,  332,  257,  316,  259,
  316,  166,  167,  211,  314,  354,  355,  303,  319,  294,
  295,  148,  149,  310,  356,  357,  358,  356,  357,  358,
  356,  357,  358,  356,  357,  358,  323,  324,  325,  326,
  327,  328,  329,  330,  294,  295,  244,  211,  310,  150,
  151,   62,  261,  288,  259,  310,  306,  307,  345,  258,
  295,  302,  324,  325,  326,  327,  328,  329,  330,  324,
  325,  326,  327,  328,  329,  330,  314,  257,  261,  259,
  244,  315,  273,  321,  322,  287,  304,  285,  322,  327,
  328,  329,  330,  327,  328,  329,  330,   62,  301,  332,
  290,  299,  292,  293,  294,  295,  296,   62,  298,  299,
  300,    7,  207,  120,  294,  295,  158,  315,  316,  158,
  290,  285,  292,  293,  294,  295,  296,  325,  298,  159,
  300,  209,   -1,   -1,   -1,  299,   -1,   -1,   -1,   -1,
  338,  339,  340,   -1,  342,   -1,  344,   -1,   -1,   -1,
   -1,  315,  316,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,  325,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
   -1,   -1,   -1,   -1,  338,  339,  340,   -1,  342,   -1,
  344,
};
}
final static short YYFINAL=2;
final static short YYMAXTOKEN=363;
final static String yyname[] = {
"end-of-file",null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,"'!'",null,null,null,null,null,null,"'('","')'","'*'","'+'",null,
"'-'",null,"'/'",null,null,null,null,null,null,null,null,null,null,null,null,
"'<'",null,"'>'",null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,"IDENTIFIER","NAME","NUMBER","STRING",
"UNFORMATTED_STRING","T_NUDROID","CT_NUDROID","T_NAVIGATION","CT_NAVIGATION",
"T_STYLE","CT_STYLE","T_PAGE","CT_PAGE","T_TEXT","CT_TEXT","T_INPUT","CT_INPUT",
"T_LINK","CT_LINK","T_IMAGE","CT_IMAGE","T_LIST","CT_LIST","T_TABLE","CT_TABLE",
"T_AUDIO","CT_AUDIO","T_VIDEO","CT_VIDEO","T_BUTTON","CT_BUTTON","T_FUNCTION",
"CT_FUNCTION","T_VAR","CT_VAR","T_GOTO","T_SETVAR","T_GETVAR","T_GETINPUT",
"T_GETTEXT","T_SETTEXT","T_LOOP","CT_LOOP","T_TEST","CT_TEST","T_TRUE",
"CT_TRUE","T_FALSE","CT_FALSE","B_TRUE","B_FALSE","P_NAME","P_PAGEID","P_URL",
"P_EMAIL","P_BULLET_STYLE","P_TYPE","P_COLS","P_FUNCTIONID","P_VALUE",
"P_CONDITION","P_START","P_END","P_ID","P_LABEL","P_STYLEID","P_POSITION",
"P_LENGTH","P_WIDTH","P_LOCATION","P_SIZE","P_COLOR","P_FONT","P_LORIENTATION",
"\"||\"","\"&&\"","\"size:\"","\"font:\"","\"color:\"","\"padding:\"",
"\"background-color:\"","\"font-style:\"","\"width:\"","\"height:\"",
"\"align:\"","\"serif\"","\"sans\"","\"mono\"","\"/>\"","\"numbers\"",
"\"AtoZ\"","\"atoz\"","\"circles\"","\"square\"","\"disc\"","\"vertical\"",
"\"horizontal\"","\"number\"","\"string\"","\"==\"","\">=\"","\"<=\"","\"top\"",
"\"bottom\"","\"left\"","\"right\"","\"center\"",
};
final static String yyrule[] = {
"$accept : app",
"app : T_NUDROID app_name '>' body CT_NUDROID",
"body :",
"body : body upper_level_tag",
"upper_level_tag : page",
"upper_level_tag : navigation",
"upper_level_tag : variable",
"upper_level_tag : style",
"app_name : P_NAME NAME",
"navigation : T_NAVIGATION tabs CT_NAVIGATION",
"tabs :",
"tabs : tabs tab",
"tab : link",
"style : T_STYLE id '>' style_body CT_STYLE",
"style_body :",
"style_body : style_body style_param",
"style_param : style_size",
"style_param : style_font",
"style_param : style_color",
"style_param : style_padding",
"style_param : style_bg",
"style_param : style_font_style",
"style_param : style_width",
"style_param : style_height",
"style_param : style_align",
"style_size : \"size:\" NUMBER",
"style_font : \"font:\" font_name",
"style_color : \"color:\" NAME",
"style_padding : \"padding:\" NUMBER",
"style_bg : \"background-color:\" NAME",
"style_font_style : \"font-style:\" NAME",
"style_width : \"width:\" NUMBER",
"style_height : \"height:\" NUMBER",
"style_align : \"align:\" NAME",
"font_name : \"serif\"",
"font_name : \"sans\"",
"font_name : \"mono\"",
"page : T_PAGE id page_params '>' page_body CT_PAGE",
"page_body :",
"page_body : page_body body_element",
"body_element : text",
"body_element : input",
"body_element : image",
"body_element : list",
"body_element : table",
"body_element : button",
"body_element : action",
"body_element : function",
"body_element : audio",
"body_element : video",
"page_params :",
"page_params : page_params page_param",
"page_param : label",
"page_param : style_p",
"text : T_TEXT id text_params '>' formatted_string CT_TEXT",
"text_params :",
"text_params : text_params text_param",
"text_param : style_p",
"input : T_INPUT id input_params '>' UNFORMATTED_STRING CT_INPUT",
"input_params :",
"input_params : input_params input_param",
"input_param : style_p",
"link : T_LINK optional_id ref link_params '>' UNFORMATTED_STRING CT_LINK",
"link : T_LINK optional_id ref link_params \"/>\"",
"ref : url",
"ref : page_id",
"ref : email",
"link_params :",
"link_params : link_params link_param",
"link_param : style_p",
"page_id : P_PAGEID NAME",
"url : P_URL STRING",
"email : P_EMAIL STRING",
"image : T_IMAGE image_params '>' formatted_string CT_IMAGE",
"image : T_IMAGE image_params \"/>\"",
"image_params :",
"image_params : image_params image_param",
"image_param : length",
"image_param : width",
"image_param : location",
"image_param : url",
"image_param : label_style",
"image_param : label_orientation",
"image_param : position",
"list : T_LIST list_params '>' list_items CT_LIST",
"list_params :",
"list_params : list_params list_param",
"list_param : style_p",
"list_param : bullet",
"list_param : type",
"list_items :",
"list_items : list_items list_item",
"list_item : text",
"list_item : image",
"list_item : link",
"bullet : P_BULLET_STYLE bullet_type",
"type : P_TYPE list_type",
"bullet_type : \"numbers\"",
"bullet_type : \"AtoZ\"",
"bullet_type : \"atoz\"",
"bullet_type : \"circles\"",
"bullet_type : \"square\"",
"bullet_type : \"disc\"",
"list_type : \"vertical\"",
"list_type : \"horizontal\"",
"table : T_TABLE id table_params '>' table_items CT_TABLE",
"table_params :",
"table_params : table_params table_param",
"table_param : style_p",
"table_param : cols",
"table_param : label",
"table_param : label_style",
"table_param : label_orientation",
"cols : P_COLS NUMBER",
"table_items :",
"table_items : table_items table_item",
"table_item : text",
"table_item : link",
"table_item : image",
"audio : T_AUDIO id audio_params '>' formatted_string CT_AUDIO",
"audio_params :",
"audio_params : audio_params audio_param",
"audio_param : size",
"audio_param : url",
"audio_param : location",
"audio_param : label_style",
"audio_param : label_orientation",
"video : T_VIDEO id video_params '>' formatted_string CT_VIDEO",
"video_params :",
"video_params : video_params video_param",
"video_param : size",
"video_param : url",
"video_param : location",
"video_param : label_style",
"video_param : label_orientation",
"button : T_BUTTON id button_params '>' UNFORMATTED_STRING CT_BUTTON",
"button_params :",
"button_params : button_params button_param",
"button_param : style_p",
"button_param : function_id",
"button_param : label_style",
"button_param : label_orientation",
"function_id : P_FUNCTIONID NAME",
"variable : T_VAR id type_p value '>'",
"variable : T_VAR id type_p '>'",
"type_p : P_TYPE type",
"type : \"number\"",
"type : \"string\"",
"value : P_VALUE expression",
"value : P_VALUE STRING",
"function : T_FUNCTION id '>' code CT_FUNCTION",
"code : action",
"code : code action",
"action : variable",
"action : goto",
"action : setvar",
"action : getvar",
"action : getinput",
"action : gettext",
"action : settext",
"action : test",
"action : loop",
"goto : T_GOTO page_id '>'",
"setvar : T_SETVAR id value '>'",
"getvar : T_GETVAR id '>'",
"getinput : T_GETINPUT id '>'",
"gettext : T_GETTEXT id '>'",
"settext : T_GETTEXT id value '>'",
"expression : expression '+' term",
"expression : expression '-' term",
"expression : term",
"term : term '*' factor",
"term : term '/' factor",
"term : factor",
"factor : '(' expression ')'",
"factor : num",
"num : NUMBER",
"num : getvar",
"num : getinput",
"num : IDENTIFIER",
"condition : condition \"||\" condition",
"condition : condition \"&&\" condition",
"condition : '!' condition",
"condition : expression relop expression",
"condition : B_TRUE",
"condition : B_FALSE",
"relop : '<'",
"relop : '>'",
"relop : \"==\"",
"relop : \">=\"",
"relop : \"<=\"",
"test : T_TEST P_CONDITION condition '>' true_code false_code CT_TEST",
"true_code : T_TRUE code CT_TRUE",
"false_code : T_FALSE code CT_FALSE",
"loop : T_LOOP P_START expression P_END expression '>' code CT_LOOP",
"id : P_ID NAME",
"optional_id :",
"optional_id : id",
"label : P_LABEL STRING",
"style_p : P_STYLEID NAME",
"position : P_POSITION position_type",
"position_type : \"top\"",
"position_type : \"bottom\"",
"position_type : \"left\"",
"position_type : \"right\"",
"position_type : \"center\"",
"size : width",
"size : length",
"length : P_LENGTH NUMBER",
"width : P_WIDTH NUMBER",
"location : P_LOCATION STRING",
"label_style : font_size",
"label_style : color",
"label_style : font",
"font_size : P_SIZE NUMBER",
"color : P_COLOR STRING",
"font : P_FONT STRING",
"label_orientation : P_LORIENTATION orientation_type",
"orientation_type : \"vertical\"",
"orientation_type : \"horizontal\"",
"formatted_string :",
"formatted_string : formatted_string UNFORMATTED_STRING",
"formatted_string : formatted_string link",
"formatted_string : formatted_string getvar",
"formatted_string : formatted_string getinput",
"formatted_string : formatted_string gettext",
};

//#line 616 "nudroid.y"

private Yylex lexer;

// Implemented Read and Save function
// Not Implemented make and copy function
public static void main(String args[])
{
	  
    
	/*StringBuilder nudroidSoucre = new StringBuilder();
	Boolean check = false;
	
	// To make default folders for Android SDK
	check = makeFolder();
	
	// To make default android XML layout
	check = makeXMLLayout();
	
	// To make default android XML list
	check = makeXMLList();
	
	// To copy default files such icon.png
	check = copyFile();
	
	// Input Src name
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	System.out.print("Type nudroid src name: ");
	try
	{
		String srcFile = br.readLine();
		nudroidSoucre = readFile(srcFile);		
	}
	catch (IOException e)
	{
		e.getMessage();
		System.out.println("File buffer error: " + e);
	}*/
	
	Parser yyparser;
	
	try {
		yyparser = new Parser(new FileReader(args[0]));
		 yyparser.yyparse();  
	} catch (FileNotFoundException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} 
	
	//check = saveFile(nudroidSoucre);
}

public static StringBuilder readFile(String srcFile)
{
	StringBuilder nudroidSoucre = new StringBuilder();
	
	try
	{
		// File open
		File dirs = new File(srcFile);
		String path = dirs.getAbsolutePath();
		File realFile = new File(path);			
		FileReader fr=new FileReader(realFile);
		BufferedReader br = new BufferedReader(fr);	
	  	  
	  String str="";
  	
  	while ((str=br.readLine())!=null)
  	{
  		nudroidSoucre.append(str);
  	}
	  			
		return nudroidSoucre;
	}
	catch (Exception e)
	{
		e.getMessage();
		System.out.println("File open error: " + e);
		
		return null;
	}
}

public static Boolean saveFile(StringBuilder nudroidSoucre)
{
	return false;
	// File open to save dest code
	// Save destSource to file - it should be saved at src/package struct (i.e /src/com/nudroid/)
	//try
	//{
//		//TODO - Giving compilation errors.
		///*File dirs = new File(nudroidSoucre);
		//String path = System.getProperty("user.dir") + "\\dest.java";
		//FileWriter fw = new FileWriter(path);
		//fw.write(nudroidSoucre);
		//fw.close();
		//System.out.println("Successed");*/
		//return true;
	//}
	//catch (IOException e)
	//{
//		e.getMessage();
		//System.out.println("File open error: " + e);
//		
		//return false;
	//}
}

public static Boolean makeFolder()
{
	// TODO: make folders
	try
	{
		return true;
	}
	catch (Exception e)
	{
		System.out.println("Err: Make folder - " + e);
		return false;
	}
}

public static Boolean makeXMLLayout()
{
	// TODO: make main XML layout
	try
	{
		return true;
	}
	catch (Exception e)
	{
		System.out.println("Err: Make XML layout - " + e);
		return false;
	}
}

public static Boolean makeXMLList()
{
	// TODO: make list XML layout
	try
	{
		return true;
	}
	catch (Exception e)
	{
		System.out.println("Err: Make list XML layout - " + e);
		return false;
	}
}

public static Boolean copyFile()
{
	// TODO: copy some files to directory that created by makeFolder function
	try
	{
		return true;
	}
	catch (Exception e)
	{
		System.out.println("Err: Copy files - " + e);
		return false;
	}
}

  /* interface to the lexer */
  private int yylex () {
    int yyl_return = -1;
    try {
      yyl_return = lexer.yylex();
    }
    catch (IOException e) {
      System.err.println("IO error :"+e);
    }
    return yyl_return;
  }


void yyerror(String s)
{
	System.err.println("Error: "+s);
}

  /* lexer is created in the constructor */
  public Parser(Reader r) {
    lexer = new Yylex(r, this);
  }

//#line 930 "Parser.java"
//###############################################################
// method: yylexdebug : check lexer state
//###############################################################
void yylexdebug(int state,int ch)
{
String s=null;
  if (ch < 0) ch=0;
  if (ch <= YYMAXTOKEN) //check index bounds
     s = yyname[ch];    //now get it
  if (s==null)
    s = "illegal-symbol";
  debug("state "+state+", reading "+ch+" ("+s+")");
}





//The following are now global, to aid in error reporting
int yyn;       //next next thing to do
int yym;       //
int yystate;   //current parsing state from state table
String yys;    //current token string


//###############################################################
// method: yyparse : parse input and execute indicated items
//###############################################################
int yyparse()
{
boolean doaction;
  init_stacks();
  yynerrs = 0;
  yyerrflag = 0;
  yychar = -1;          //impossible char forces a read
  yystate=0;            //initial state
  state_push(yystate);  //save it
  val_push(yylval);     //save empty value
  while (true) //until parsing is done, either correctly, or w/error
    {
    doaction=true;
    if (yydebug) debug("loop"); 
    //#### NEXT ACTION (from reduction table)
    for (yyn=yydefred[yystate];yyn==0;yyn=yydefred[yystate])
      {
      if (yydebug) debug("yyn:"+yyn+"  state:"+yystate+"  yychar:"+yychar);
      if (yychar < 0)      //we want a char?
        {
        yychar = yylex();  //get next token
        if (yydebug) debug(" next yychar:"+yychar);
        //#### ERROR CHECK ####
        if (yychar < 0)    //it it didn't work/error
          {
          yychar = 0;      //change it to default string (no -1!)
          if (yydebug)
            yylexdebug(yystate,yychar);
          }
        }//yychar<0
      yyn = yysindex[yystate];  //get amount to shift by (shift index)
      if ((yyn != 0) && (yyn += yychar) >= 0 &&
          yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
        {
        if (yydebug)
          debug("state "+yystate+", shifting to state "+yytable[yyn]);
        //#### NEXT STATE ####
        yystate = yytable[yyn];//we are in a new state
        state_push(yystate);   //save it
        val_push(yylval);      //push our lval as the input for next rule
        yychar = -1;           //since we have 'eaten' a token, say we need another
        if (yyerrflag > 0)     //have we recovered an error?
           --yyerrflag;        //give ourselves credit
        doaction=false;        //but don't process yet
        break;   //quit the yyn=0 loop
        }

    yyn = yyrindex[yystate];  //reduce
    if ((yyn !=0 ) && (yyn += yychar) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
      {   //we reduced!
      if (yydebug) debug("reduce");
      yyn = yytable[yyn];
      doaction=true; //get ready to execute
      break;         //drop down to actions
      }
    else //ERROR RECOVERY
      {
      if (yyerrflag==0)
        {
        yyerror("syntax error");
        yynerrs++;
        }
      if (yyerrflag < 3) //low error count?
        {
        yyerrflag = 3;
        while (true)   //do until break
          {
          if (stateptr<0)   //check for under & overflow here
            {
            yyerror("stack underflow. aborting...");  //note lower case 's'
            return 1;
            }
          yyn = yysindex[state_peek(0)];
          if ((yyn != 0) && (yyn += YYERRCODE) >= 0 &&
                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
            {
            if (yydebug)
              debug("state "+state_peek(0)+", error recovery shifting to state "+yytable[yyn]+" ");
            yystate = yytable[yyn];
            state_push(yystate);
            val_push(yylval);
            doaction=false;
            break;
            }
          else
            {
            if (yydebug)
              debug("error recovery discarding state "+state_peek(0)+" ");
            if (stateptr<0)   //check for under & overflow here
              {
              yyerror("Stack underflow. aborting...");  //capital 'S'
              return 1;
              }
            state_pop();
            val_pop();
            }
          }
        }
      else            //discard this token
        {
        if (yychar == 0)
          return 1; //yyabort
        if (yydebug)
          {
          yys = null;
          if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
          if (yys == null) yys = "illegal-symbol";
          debug("state "+yystate+", error recovery discards token "+yychar+" ("+yys+")");
          }
        yychar = -1;  //read another
        }
      }//end error recovery
    }//yyn=0 loop
    if (!doaction)   //any reason not to proceed?
      continue;      //skip action
    yym = yylen[yyn];          //get count of terminals on rhs
    if (yydebug)
      debug("state "+yystate+", reducing "+yym+" by rule "+yyn+" ("+yyrule[yyn]+")");
    if (yym>0)                 //if count of rhs not 'nil'
      yyval = val_peek(yym-1); //get current semantic value
    yyval = dup_yyval(yyval); //duplicate yyval if ParserVal is used as semantic value
    switch(yyn)
      {
//########## USER-SUPPLIED ACTIONS ##########
case 1:
//#line 103 "nudroid.y"
{
	System.out.println("Reducing app");

	/*$$.sval = "import android.app.Activity;\n" +
	"import android.os.Bundle;\n" +
	"import android.widget.*;\n" +
	
	"public class " + $2.sval + " extends Activity\n" + 
	"{\n" +
		"\t// Default layout\n" +
    "\tRelativeLayout nudroidLayout;" +
    "Intent intent;\n" +
    "int autoID = 1;\n\n";*/
			
		/*@Override
		public void onCreate(Bundle savedInstanceState) 
		{
				super.onCreate(savedInstanceState);
			
        // To create default layout
        nudroidLayout = new RelativeLayout(this);
              
        $4.sval;
        
        // To show views
        setContentView(nudroidLayout);
		}
	}
	//'"';*/
}
break;
case 2:
//#line 135 "nudroid.y"
{System.out.println("Empty body");}
break;
case 8:
//#line 146 "nudroid.y"
{System.out.println("Name");}
break;
case 37:
//#line 214 "nudroid.y"
{
				/* To define layout param*/
       /* RelativeLayout.LayoutParams lp1 = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
        lp1.addRule(RelativeLayout.CENTER_HORIZONTAL);
        pageTextView.setLayoutParams(lp1);
        
        // To create page text
        TextView $1.sval;
        pageTextView.setText($2.sval);
        nudroidLayout.addView($1.sval);
        
        pageTextView = new TextView(this);
        pageTextView.setId(autoID++);*/
}
break;
case 54:
//#line 257 "nudroid.y"
{
	/* To create sample text*/
	/*TextView $1.sval = new TextView(this);
	$1.setText($3.sval);
	nudroidLayout.addView($1.sval);*/
}
break;
//#line 1146 "Parser.java"
//########## END OF USER-SUPPLIED ACTIONS ##########
    }//switch
    //#### Now let's reduce... ####
    if (yydebug) debug("reduce");
    state_drop(yym);             //we just reduced yylen states
    yystate = state_peek(0);     //get new state
    val_drop(yym);               //corresponding value drop
    yym = yylhs[yyn];            //select next TERMINAL(on lhs)
    if (yystate == 0 && yym == 0)//done? 'rest' state and at first TERMINAL
      {
      if (yydebug) debug("After reduction, shifting from state 0 to state "+YYFINAL+"");
      yystate = YYFINAL;         //explicitly say we're done
      state_push(YYFINAL);       //and save it
      val_push(yyval);           //also save the semantic value of parsing
      if (yychar < 0)            //we want another character?
        {
        yychar = yylex();        //get next character
        if (yychar<0) yychar=0;  //clean, if necessary
        if (yydebug)
          yylexdebug(yystate,yychar);
        }
      if (yychar == 0)          //Good exit (if lex returns 0 ;-)
         break;                 //quit the loop--all DONE
      }//if yystate
    else                        //else not done yet
      {                         //get next state and push, for next yydefred[]
      yyn = yygindex[yym];      //find out where to go
      if ((yyn != 0) && (yyn += yystate) >= 0 &&
            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
        yystate = yytable[yyn]; //get new state
      else
        yystate = yydgoto[yym]; //else go to new defred
      if (yydebug) debug("after reduction, shifting from state "+state_peek(0)+" to state "+yystate+"");
      state_push(yystate);     //going again, so push state & val...
      val_push(yyval);         //for next action
      }
    }//main loop
  return 0;//yyaccept!!
}
//## end of method parse() ######################################



//## run() --- for Thread #######################################
/**
 * A default run method, used for operating this parser
 * object in the background.  It is intended for extending Thread
 * or implementing Runnable.  Turn off with -Jnorun .
 */
public void run()
{
  yyparse();
}
//## end of method run() ########################################



//## Constructors ###############################################
/**
 * Default constructor.  Turn off with -Jnoconstruct .

 */
public Parser()
{
  //nothing to do
}


/**
 * Create a parser, setting the debug to true or false.
 * @param debugMe true for debugging, false for no debug.
 */
public Parser(boolean debugMe)
{
  yydebug=debugMe;
}
//###############################################################



}
//################### END OF CLASS ##############################
